package de.tudarmstadt.ukp.wikisniffer.userstudy.gui;

import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Font;
import java.awt.Rectangle;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import de.tudarmstadt.ukp.wikisniffer.userstudy.Client;

@SuppressWarnings("serial")
public abstract class AbstractInfoGui extends AbstractGui{
	
	protected String buttonLabel = "Weiter";
	
	protected Rectangle bounds;
	
	public void open(){
		this.setBounds(bounds);
		this.setTitle(this.getClass().getSimpleName());
		this.setLayout(new BorderLayout(0,0));
		
		TextField tfWelcome = new TextField(textFieldContent);
		tfWelcome.setEditable(false);
		tfWelcome.setFont(new Font("Arial", Font.PLAIN, 18));
		this.add(tfWelcome, BorderLayout.NORTH);
		
		//add buttons
		this.add(getContentPanel(),BorderLayout.CENTER);
		
		this.setVisible(true);
		
		// add listener to detect window close button
		addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				//do nothing because participant should not be able to change procedure of test
				//Client.client.openStartGui(e);
			} 
		});
		
		//open questions
		Button bSubmit=new Button(buttonLabel);
		this.add(bSubmit,BorderLayout.EAST);
		bSubmit.addActionListener(
				new ActionListener(){
					public void actionPerformed(ActionEvent arg0) {
						Client.client.nextScreen();
					}
				}
		);
	}
	


}
